package tanshiru2.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import tanshiru2.entity.User;
import tanshiru2.mapper.UserMapper;
@Service
public class UserService extends ServiceImpl<UserMapper, User> {
    /**
     * 通过用户名查找用户信息
     * @param user
     * @return
     */
    public User findUserByUserAccount(User user){
        LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(User::getUserAccount,user.getUserAccount());
        return this.getOne(lambdaQueryWrapper);
    }
}
